Inside Macintosh: Files

Previous | Chapter Top | Chapter Contents | Next

Identifying Files and Directories

The hierarchical arrangement of files and directories allows you to identify a file or directory uniquely by providing just three pieces of information: its volume reference number, its parent directory ID, and its name within that parent directory. The system software lets you specify these three items together in a file system specification record, defined by the FSSpec data type:

TYPE FSSpec         =               {file system specification}
RECORD
    vRefNum:        Integer;        {volume reference number}
    parID:          LongInt;        {directory ID of parent directory}
    name:           Str63;          {filename or directory name}
END;

The FSSpec record provides a simple and standard format for specifying files and directories. For example, the Standard File Package procedure StandardGetFile uses an FSSpec record to return information identifying a user-selected file or folder. You can pass that specification directly to any file-manipulation routines, such as FSpOpenDF and FSpDelete , that accept FSSpec records. In addition, the Alias Manager, Edition Manager, and Finder all use FSSpec records to specify files and directories.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next